//
//  NSDate+MMG2String.m
//  MyApp
//
//  Created by Don on 2017/9/7.
//  Copyright © 2017年 com.memego. All rights reserved.
//

#import "NSDate+MMG2String.h"


@implementation NSDate (MMG2String)
+ (NSString *)mmg_todayStringWithFormat:(NSString *)format {
    return [[NSDate date] toStringWithFormat:format];
}

- (NSString *)toStringWithFormat:(NSString *)dateFormatterStr {
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    formatter.dateFormat = dateFormatterStr;
    //    NSLocale *twentyFour = [[NSLocale alloc] initWithLocaleIdentifier:@"en_GB"];
    //    formatter.locale = twentyFour;
    NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:DEFAULT_TIME_ZONE];
    [formatter setTimeZone:timeZone];
    return [formatter stringFromDate:self];
}
@end
